package com.gitee.wsl.unit.angle

import kotlin.math.PI

/**
 * Defines the orientation of the Zero angle on a [PolarGraph]. 3 O'Clock is the regular convention for
 * mathematics, while 12 O'Clock is typical for category based charts and spider charts.
 */
 enum class PolarAngleZero {
    THREE_OCLOCK,
    SIX_OCLOCK,
    NINE_OCLOCK,
    TWELVE_OCLOCK,
}

val PolarAngleZero.originOffset: Double
    get() = when (this) {
        PolarAngleZero.THREE_OCLOCK -> 0.0
        PolarAngleZero.SIX_OCLOCK -> PI / 2.0
        PolarAngleZero.NINE_OCLOCK -> PI
        PolarAngleZero.TWELVE_OCLOCK -> -PI / 2.0
    }